<template>
  <transition name="mei-modal-fade">
    <div
      v-show="show"
      class="mei-modal"
      tabindex="-1"
      role="dialog"
      aria-labelledby="bombConfirmLabel"
      aria-hidden="false"
    >
      <div class="mei-modal-mask" @click.stop="onClosed"></div>
      <div class="mei-modal-wrap">
        <div class="mei-modal-content">
          <div class="mei-modal-header">
            <div class="mei-modal-header-title">{{title}}</div>
            <!-- <div class="mei-modal-header-txt">{{text}}</div> -->
          </div>
          <div class="mei-modal-footer">
            <!-- 取消时间 可以添加类似确认的回调 -->
            <div
              type="button"
              class="mei-btn mei-btn-primary"
              id="confirmButtons1"
              @click="confirmButton.ontap"
            >{{confirmButton.text}}</div>
            <div
              type="button"
              class="mei-btn mei-btn-cancel"
              id="confirmButtons1"
              @click="onClosed"
            >{{cancelButton.text}}</div>
          </div>
        </div>
      </div>
    </div>
  </transition>
</template>

<script>
export default {
  data() {
    return {
      show: true,
      title: "",
      text: "",
      button: []
    };
  },
  methods: {
    onClosed() {
      this.close();
    }
  }
};
</script>

<style rel="stylesheet">
.mei-modal .mei-modal-mask {
  position: fixed;
  overflow: auto;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2010;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  background-color: rgba(0, 0, 0, 0.4);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.mei-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20010;
}

.mei-modal .mei-modal-wrap {
  z-index: 2012;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  width: 400px;
  height: 180px;
  user-select: none;
  background-color: #fff;
  /* box-shadow: 0px 4px 15px 0px rgba(0, 0, 0, 0.4); */
  border-radius: 4px;
}

.mei-modal .mei-modal-wrap .mei-modal-content {
  width: 400px;
  height: 180px;
  user-select: none;
  background-color: #fff;
  box-shadow: 0px 4px 15px 0px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  outline: 0;
  z-index: 2012;
  overflow: hidden;
}

.mei-modal .mei-modal-header {
  height: 116px;
  width: 100%;
}

.mei-modal .mei-modal-header .mei-modal-header-title {
  height: 116px;
  width: 100%;
  font-size: 16px;
  color: rgba(44, 44, 44, 1);
  line-height: 116px;
  text-align: center;
  overflow: hidden;
}

.mei-modal .mei-modal-header .mei-modal-header-txt {
  height: 44px;
  width: 100%;
  font-size: 16px;

  font-weight: 400;
  color: rgba(51, 51, 51, 1);
  line-height: 44px;
  text-align: center;
  overflow: hidden;
}

.mei-modal .mei-modal-footer {
  width: 100%;
  height: 64px;
  background: rgba(241, 241, 241, 1);
  border-radius: 0px 0px 4px 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.mei-modal .mei-modal-footer .mei-btn {
  width: 90px;
  height: 32px;
  border-radius: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  margin-right: 20px;
  margin-left: 20px;
}

.mei-modal .mei-modal-footer .mei-btn-primary {
  border: 1px solid rgba(192, 192, 192, 1);
  color: rgba(132, 132, 132, 1);
}
.mei-modal .mei-modal-footer .mei-btn-cancel {
  background: rgba(255, 94, 41, 1);
  color: rgba(255, 255, 255, 1);
}
.mei-modal-fade-enter,
.mei-modal-fade-leave-to {
  transform: scale(0);
}

.mei-modal-fade-enter-active {
  animation: bounce-in 0.3s;
}

.mei-modal-fade-leave-active {
  animation: bounce-in 0.3s reverse;
}

@keyframes bounce-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
</style>
